﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GSPatEditor.Simulator
{
    enum ActorAirInitType
    {
        Still,
        Jump,
        ForwardJump,
        BackwardJump,
    }

    static class ActorInit
    {
        public static void InitPlayer(this Actor actor)
        {
            actor.ImmuneGravity = false;
            actor.DefaultGravity = 1.0f;
            actor.Priority = 100;

            actor.CollisionEnabled = true;
        }

        public static void InitPlayerGround(this Actor actor)
        {
            actor.IsInAir = false;
        }

        public static void InitPlayerAir(this Actor actor, ActorAirInitType type)
        {
            actor.IsInAir = true;
            switch (type)
            {
                case ActorAirInitType.Still:
                    break;
                case ActorAirInitType.Jump:
                    actor.VY = -15;
                    break;
                case ActorAirInitType.ForwardJump:
                    actor.VY = -15;
                    actor.VX = 4;
                    break;
                case ActorAirInitType.BackwardJump:
                    actor.VY = -15;
                    actor.VX = -4;
                    break;
            }
        }

        public static void InitShot(this Actor actor)
        {
            actor.ImmuneGravity = true;
            actor.IsInAir = true;
            actor.CollisionEnabled = false;
            actor.Priority = 300;
        }
    }
}
